import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Ciudad here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Ciudad extends Mundo
{
    private GreenfootSound musi=new GreenfootSound("TDC.mp3");
    private Cartman cartman;
   // private GreenfootImage Background = (new GreenfootImage("fondo.jpg"));
    private int x=0;
    private int y=0;
    /**
     * Constructor for objects of class Ciudad.
     * 
     */
    public Ciudad()
    {    
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        super(7000, 2000, 1,false); 
        prepare();
    }

    /**
     * Prepare the world for the start of the program. That is: create the initial
     * objects and add them to the world.
     */

    /**
     * Prepare the world for the start of the program. That is: create the initial
     * objects and add them to the world.
     */
    private void prepare()
    {
        setPaintOrder(Enemigo.class,Letrero.class,Escopeta.class,Ametralladora.class,Pistola.class,Cartman.class,casaCartman.class,Casa1.class,cerca.class);
        cartman = new Cartman();
        addObject(cartman, 64, 333);
      
        cartman.setLocation(61, 300);
        cartman.setRotation(90);
        
       
       
        
        Casa1 casa1 = new Casa1(false, 0);
        addObject(casa1, 738, 170);
       // casa1.setLocation(738, 213);
        
        Casa1 casa12 = new Casa1(false, 0);
        addObject(casa12, 1464, 170);
        //casa12.setLocation(1264, 219);
        
        
        Casa1 casa13 = new Casa1(true, 1);
        addObject(casa13, 2300, 170);
        //casa13.setLocation(1795, 227);
        
        Carretera ca=new Carretera();
        addObject(ca,743,484);
        Carretera cb=new Carretera();
        addObject(cb,2200,484);
        casaCartman cart=new casaCartman();
        addObject(cart,170,250);
         
        Carretera cc=new Carretera();
        addObject(cc,3700,484);
        Carretera cd=new Carretera();
        addObject(cd,5200,484);
        
        Carretera ce=new Carretera();
        addObject(ce,6700,484);
        
        Carretera cf=new Carretera();
        addObject(cf,2250,1262);
        cf.setRotation(90);
        
        Carretera cg=new Carretera();
        addObject(cg,743,1262);
        
        Carretera ch=new Carretera();
        addObject(ch,2200,1262);
        
        Carretera ci=new Carretera();
        addObject(ci,3700,1262);
        Carretera cj=new Carretera();
        addObject(cj,5200,1262);
        Carretera ck=new Carretera();
        addObject(ck,6700,1262);
        
        Casa1 wal=new Casa1(4);
        addObject(wal,4337,200);
        
        Casa1 casa14=new Casa1(false,0);
        addObject(casa14,2731,952);
        
        Casa1 casa15=new Casa1(false,0);
        addObject(casa15,3500,952);
        
        Casa1 casa16=new Casa1(false,0);
        addObject(casa16,4300,952);
        
        Casa1 hall=new Casa1(5);
        addObject(hall,394,872);
        
        Casa1 esc=new Casa1(6);
        addObject(esc,6221,930);
        
        Casa1 casbo=new Casa1(7);
        addObject(casbo,6305,182);
        
        Guardian g1=new Guardian();
        addObject(g1,2300,300);
        
        Cangrejo ca1=new Cangrejo(1);
        Cangrejo ca2=new Cangrejo(1);
        Cangrejo ca3=new Cangrejo(1);
        Cangrejo ca4=new Cangrejo(1);
        addObject(ca1,2300,350);
        addObject(ca2,2300,450);
        addObject(ca3,2600,350);
        addObject(ca4,2600,450);
        
        Guardian g2=new Guardian();
        addObject(g2,6053,1090);
        
        Guardian g3=new Guardian();
        addObject(g3,6253,1090);
        
        Cangrejo ca5=new Cangrejo(1);
        Cangrejo ca6=new Cangrejo(1);
        Cangrejo ca7=new Cangrejo(1);
        Cangrejo ca8=new Cangrejo(1);
        addObject(ca5,6250,1100);
        addObject(ca6,6250,1200);
        addObject(ca7,6550,1100);
        addObject(ca8,6550,1200);
        
    }
    
    public Cartman getCartman(){
       return cartman;
    }
    public void act(){
        musi.playLoop();
        
        
     }
     
  
   
}